﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo02
{
    class Animal
    {
        private int leg;
        public int Leg
        {
            get { return this.leg; }
            set { this.leg = value; }
        }
        public void Walk()
        {
            Console.WriteLine("我会走路");
        }
        public void Eat()
        {
            Console.WriteLine("我会吃");
        }
        public void Sleep()
        {
            Console.WriteLine("我会睡");
        }
        public virtual void Cry()//virtual 虚方法
        {

            Console.WriteLine("准备");
        }


    }
}
